﻿using System;
using System.Collections.Generic;
using Unknown.Framework.Database;
using Unknown.Framework.Transform;
using Unknown.Source.Entity.Example;

namespace Unknown.Source.OracleSql.Example
{
	/// <summary>
	/// 艺术品操作处理类
	/// </summary>
	public class ArtworkOperationHandler : AbstractReaderOperationHandler<Artwork>
	{
		/// <summary>
		/// 转换
		/// </summary>
		/// <returns>结果</returns>
		protected override Artwork Transform()
		{
			Artwork result = new Artwork();

			this.FieldPrefix = "T_";

			result.Pkid = this.AssignString("PKID", null);
			result.Museum = this.AssignString("MUSEUM", null);
			result.Name = this.AssignString("NAME", null);
			result.Code = this.AssignString("CODE", null);
			result.EnglishDescription = this.AssignString("ENGLISH_DESCRIPTION", null);
			result.EnglishRemark = this.AssignString("ENGLISH_REMARK", null);
			result.ChineseDescription = this.AssignString("CHINESE_DESCRIPTION", null);
			result.ChineseRemark = this.AssignString("CHINESE_REMARK", null);
			result.Photo = this.AssignBinary("PHOTO", null);
			result.Video = this.AssignBinary("VIDEO", null);
			result.FirstCareTime = this.AssignTime("FIRST_CARE_TIME", DateTime.MinValue);
			result.LastCareTime = this.AssignTime("LAST_CARE_TIME", null);
			result.FirstShowTime = this.AssignTime("FIRST_SHOW_TIME", DateTime.MinValue);
			result.LastShowTime = this.AssignTime("LAST_SHOW_TIME", null);
			result.CareTimes = this.AssignInteger("CARE_TIMES", 0);
			result.ShowTimes = this.AssignInteger("SHOW_TIMES", null);
			result.PhotoVisit = this.AssignNumber("PHOTO_VISIT", 0);
			result.VideoVisit = this.AssignNumber("VIDEO_VISIT", null);
			result.Cost = this.AssignDecimal("COST", 0);
			result.Value = this.AssignDecimal("VALUE", null);

			return result;
		}
	}
}
